<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
        
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/menu.js"></script>    
        
	<script type="text/javascript" src="__PUBLIC__/js/select.js"></script>
  <style>
    table.order_tab tr td{
      border-collapse: collapse;
      border: 1px solid #eaeaea;
      padding: 5px 10px;
      font-size: 12px;
    }
  </style>
    
<title>数码商城个人中心</title>
</head>
<body>  
<!--Begin Header Begin-->
<include file="./Public/file/top.html" />
<!--End Header End--> 
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
	<div class="m_content">
   		<include file="./Zxshop/Home/View/Member/left.html" />
		<div class="m_right">
            <div class="mem_tit">我的订单</div>
            <table border="0" class="order_tab" style="width:930px; text-align:center; margin-bottom:30px;" cellspacing="0" cellpadding="0">
              <tr>                              
                <td width="20%">订单号</td>
                <td width="20%">下单时间</td>
                <td width="15%">订单总金额</td>
                <td width="20%">订单状态</td>
                <td width="25%">操作</td>
              </tr>
              <php>$status = ['1'=>'未发货','2'=>'已发货','3'=>'无效订单','4'=>'订单完成'];</php>
              <foreach name="order" item="val">
                <tr>
                  <td><font color="#ff4e00">{$val['orderid']}</font></td>
                  <td>{:date("Y-m-d",$val['addtime'])}</td>
                  <td>{$val['total']}</td>
                  <td>{$status[$val['status']]}</td>
                  <td>
                    <a href="javascript:order_success({$val['id']})">确定收货</a>　
                    <a href="{:U('home/member/Member_orderdetail',['id'=>$val['id']])}">查看详情</a>　
                    <a href="javascript:order_del({$val['id']})">取消订单</a>
                  </td>
                </tr>
              </foreach>
            </table>
        </div>
        <script>
          function order_del(id){
            if({$val['status']}==1){
              if(confirm("确定要取消？")){
                init(id);
              }
            }else{
              init(id);
            } 
          }

          function init(id){
            jQuery.get(
              "{:U('home/member/order_del')}",
              {'id':id},
              function(data){
                if(data=="1"){
                  alert("取消成功");
                  window.location.reload();
                }else if(data=="2"){
                  alert("亲，已经发货了，请耐心等候收货~~~");
                }else if(data=="3"){
                  alert("亲，这是无效订单");
                }else if(data=="4"){
                  alert("亲，订单已经完成了哦");
                }
              }
            )
          }

          function order_success(id){
            if(confirm("亲，确定收货了吗？")){
              jQuery.get(
                "{:U('home/member/order_success')}",
                {'id':id,},
                  function(data){
                    if(data){
                      alert('购物完成，感谢您的支持');
                      window.location.reload();
                    }else{
                      alert('订单已完成或取消或作废');
                    }
                  }
                )
            }
          }


        </script>
    </div>
	<!--End 用户中心 End--> 
<include file="./Public/file/bottom.html" />
</div>

</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
